package com.platform.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.platform.entity.Product;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.platform.mapper.ProductMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ProductService extends ServiceImpl<ProductMapper, Product> {

    @Resource
    private ProductMapper productMapper;

//    public IPage<Product> findPage(Page<Product> page, String name) {
//        return productMapper.findPage(page, name);
//    }

    public IPage<Product> pageByCategory(Page<Product> page, Long id) {
        return productMapper.pageByCategory(page, id);
    }

    public List<Product> recommend() {
        return productMapper.getRecommend();
    }

    public List<Product> sales() {
        return productMapper.sales();
    }

//    public List<Product> findAll() {
//        return productMapper.findAll();
//    }
}
